

namespace Stee.CAP8.MessageBus.Interface.Delegates
{
    using Stee.CAP8.MessageBus.Interface.Models;

    /// <summary>
    /// Handler for message publish outcome
    /// </summary>
    /// <typeparam name="TMessage">Message data type</typeparam>
    /// <param name="publishOutcome">Published outcome</param>
    /// <returns>Return TRUE if published outcome is handled successfully else FALSE</returns>
    public delegate bool HandlePublishResponse<TMessage>(PublishOutcome<TMessage> publishOutcome);

    /// <summary>
    /// Handler for incoming message from subscribed topic
    /// </summary>
    /// <typeparam name="TMessage">Message data type</typeparam>
    /// <param name="topic"></param>
    /// <param name="message"></param>
    /// <param name="rawMessage"></param>
    /// <returns>Return TRUE if the incoming message was processed successfully else FALSE</returns>
    public delegate bool HandleSubscribeTopic<TMessage>(TopicName topic, TMessage message, object rawMessage);
}
